package com.cwl.action;


import org.springframework.beans.BeanUtils;

import com.cwl.domain.Answer;
import com.cwl.service.AnswerService;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class AnswerAction extends ActionSupport implements ModelDriven<Answer>{
	private Answer answer= new Answer();
	private AnswerService answerservice;
	public String save(){
		Answer newanswer = new Answer();
		BeanUtils.copyProperties(this.getModel(), newanswer);
		this.answerservice.save(newanswer);
		return "save";
	}
	
	
	public Answer getModel() {
		// TODO Auto-generated method stub
		return answer;
	}
	public AnswerService getAnswerservice() {
		return answerservice;
	}

	public void setAnswerservice(AnswerService answerservice) {
		this.answerservice = answerservice;
	}
	
}
